package swingExtensions.component.format;

import java.text.FieldPosition;
import java.text.Format;
import java.text.ParsePosition;

public class UpperCaseFormat extends Format {

    public UpperCaseFormat() {}

    @Override
    public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {
        return obj == null ? toAppendTo : toAppendTo.append(obj.toString().toUpperCase());
    }

    @Override
    public Object parseObject(String source, ParsePosition pos) {
        return source;
    }
}
